package org.example.demo;

import java.io.Console;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;

/**
 * @ClassName Demo3
 * @Description
 * @Author zhangsw
 * @Date 2020/11/9 16:04
 * @Version 1.0
 */
public class Demo3 {
    public static void main(String[] args) throws IOException {
        //内存中写入到磁盘
        //输出到根目录
        FileOutputStream fos = new FileOutputStream("aaa.txt");
        fos.write(99);
        fos.close();

        FileOutputStream fos2 = new FileOutputStream("bbb.txt");
        byte[] bytes = "您好".getBytes();
        System.err.println(bytes);
        System.err.println(Arrays.toString(bytes));
        fos2.write(bytes, 0, bytes.length);
        fos2.close();
    }
}
